<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>Dashboard &laquo; Admin</title>
  <link rel="stylesheet" href="/public/assets/vendors/bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="/public/assets/vendors/font-awesome/css/font-awesome.css">
  <link rel="stylesheet" href="/public/assets/vendors/nprogress/nprogress.css">
  <link rel="stylesheet" href="/public/assets/css/admin.css">
  <script src="/public/assets/vendors/nprogress/nprogress.js"></script>
  <!-- 子页面的css等内容 -->
  {{block 'head'}}
  {{/block}}
</head>
<body>
  <script>NProgress.start()</script>

  <div class="main">
    <nav class="navbar">
      <button class="btn btn-default navbar-btn fa fa-bars"></button>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="profile.html"><i class="fa fa-user"></i>个人中心</a></li>
        <li><a href="/api/logout"><i class="fa fa-sign-out"></i>退出</a></li>
      </ul>
    </nav>
    <!-- 子页面的html内容 -->
    {{block 'content'}}
    {{/block}}
  </div>

  <div class="aside">
    <div class="profile">
      <img class="avatar" src="/public/assets/img/avatar-max-img.png">
      <h3 class="name">{{userMessage.admin_nickname}}</h3>
    </div>
    <ul class="nav">
      <li class="active">
        <a href="/admin"><i class="fa fa-dashboard"></i>仪表盘</a>
      </li>
      <li>
        <a href="#menu-posts" class="collapsed" data-toggle="collapse">
          <i class="fa fa-thumb-tack"></i>文章<i class="fa fa-angle-right"></i>
        </a>
        <ul id="menu-posts" class="collapse">
          <li><a href="/admin/posts">所有文章</a></li>
          <li><a href="/admin/post-add">写文章</a></li>
          <li><a href="/admin/categories">分类目录</a></li>
        </ul>
      </li>
      <li>
        <a href="/admin/comments"><i class="fa fa-comments"></i>评论</a>
      </li>
      <li>
        <a href="/admin/users"><i class="fa fa-users"></i>用户</a>
      </li>
      <li>
        <a href="#menu-settings" class="collapsed" data-toggle="collapse">
          <i class="fa fa-cogs"></i>设置<i class="fa fa-angle-right"></i>
        </a>
        <ul id="menu-settings" class="collapse">
          <li><a href="/admin/nav-menus">导航菜单</a></li>
          <li><a href="/admin/slides">图片轮播</a></li>
          <li><a href="/admin/settings">网站设置</a></li>
        </ul>
      </li>
    </ul>
  </div>

  <script src="/public/assets/vendors/jquery/jquery.js"></script>
  <script src="/public/assets/vendors/bootstrap/js/bootstrap.js"></script>
  <script src="/public/assets/vendors/art-template/template-web.js"></script>
  <!-- 引入 jquery-validation 表单验证插件 -->
  <script src="/node_modules/jquery-validation/dist/jquery.validate.min.js"></script>
  <script src="/node_modules/jquery-validation/dist/localization/messages_zh.min.js"></script>
  <script>
    // 顶部进度条结束
    NProgress.done()
    
    // 修改客户端模板引擎的语法界定符，如果不修改，服务端会把模板解析掉，因为服务端用了同样的模板引擎
    template.defaults.rules[1].test = /{%([@#]?)[ \t]*(\/?)([\w\W]*?)[ \t]*%}/;  
  </script>
  <!-- 子页面的js -->
  {{block 'script'}}
  {{/block}}
</body>
</html>
